//
//  NSString+StringColor.m
//  NewsClient-GraduationProject
//
//  Created by 陆文宇 on 16/3/5.
//  Copyright © 2016年 陆文宇. All rights reserved.
//

#import "NSString+StringColor.h"

@implementation NSString (StringColor)

- (UIColor *)stringColor
{
    if ([self isEqualToString:@"白色"]) {
        return [UIColor whiteColor];
    } else if ([self isEqualToString:@"红色"]) {
        return [UIColor colorWithRed:1.000 green:0.000 blue:0.000 alpha:0.555];
    } else if ([self isEqualToString:@"绿色"]) {
        return [UIColor colorWithRed:0.000 green:1.000 blue:0.000 alpha:0.508];
    } else if ([self isEqualToString:@"蓝色"]) {
        return [UIColor colorWithRed:0.000 green:0.000 blue:1.000 alpha:0.564];
    } else if ([self isEqualToString:@"青蓝色"]) {
        return [UIColor colorWithRed:0.000 green:1.000 blue:1.000 alpha:0.519];
    } else if ([self isEqualToString:@"黄色"]) {
        return [UIColor colorWithRed:1.000 green:1.000 blue:0.000 alpha:0.546];
    } else if ([self isEqualToString:@"品红色"]) {
        return [UIColor colorWithRed:1.000 green:0.000 blue:1.000 alpha:0.536];
    } else if ([self isEqualToString:@"橙色"]) {
        return [UIColor colorWithRed:1.000 green:0.500 blue:0.000 alpha:0.567];
    } else if ([self isEqualToString:@"紫色"]) {
        return [UIColor colorWithRed:0.500 green:0.000 blue:0.500 alpha:0.533];
    } else if ([self isEqualToString:@"棕色"]) {
        return [UIColor colorWithRed:0.600 green:0.400 blue:0.200 alpha:0.594];
    } else if ([self isEqualToString:@"灰色"]) {
        return [UIColor lightGrayColor];
    }
    return [UIColor whiteColor];
}

@end
